import React, {Component} from "react";
import {ImageBackground, TextInput, TouchableOpacity, View} from "react-native";
import pool_find from "../assets/Pool/pool_find.png";
import {fontSize_15} from "../smartxL2/theme";
import {Text} from "react-native-elements";
type props = {
    setSearchText:any,
    navigation:any
};
export default class NoHeaderInput extends Component {
    constructor(props:props) {
        super(props);
        this.state = {
            setSearchText : this.props.setSearchText,
            navigation:this.props.navigation
        };
    }

    render() {
        return (
            <View style={{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}>
                <View style={{justifyContent:"center",height:30,flex:1,flexDirection:"row",backgroundColor:"#f5f6f8",borderRadius:20,marginTop:10}}>
                    <ImageBackground
                        source={pool_find}
                        style={{ width: 15, height:15, marginLeft:10,paddingRight:25,alignSelf:'center' }} />
                    <TextInput
                        underlineColorAndroid={'transparent'}
                        placeholder= {"搜索代币名称/合约/项目名称"}
                        onChangeText={
                            (value) => {
                                this.state.setSearchText(value)
                            }
                        }
                        style={{
                            flex:1,
                            padding:0,
                            paddingRight:20,
                            fontSize:fontSize_15
                        }
                        }
                    />
                </View>
                <TouchableOpacity
                    style={{height:30,marginTop:10,width:50,alignItems:"center",justifyContent:"flex-end",flexDirection:"row"}}
                    activeOpacity={1} onPress={()=>{
                    this.state.navigation.goBack();
                }}>
                    <Text style={{fontSize:fontSize_15,textAlignVertical:"center",textAlign:"center"}}>{"取消"}</Text>
                </TouchableOpacity>
                {/*<Text style={{marginLeft:"2%",alignSelf:"center",fontWeight:"bold"}}>取消</Text>*/}
            </View>
        );
    }
}
